package com.lz.gmall.product.rpc;

import com.lz.gmall.common.result.Result;
import com.lz.gmall.common.result.ResultCodeEnum;
import com.lz.gmall.product.biz.CategoryBizService;
import com.lz.gmall.product.service.BaseCategory3Service;
import com.lz.gmall.product.vo.CategoryVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/api/inner/product")

public class CategoryRpcController {

    @Autowired
    private CategoryBizService categoryBizService;

    /**
     * 远程调用的接口开发，用于前台页面获取搜索栏中的所有产品（1级，2级，3级）
     * @return
     */
    @GetMapping("/findAllCategory")
    public Result<List<CategoryVo>> findAllCategory(){
        List<CategoryVo> categoryVoList = categoryBizService.findAllCategory();
        return Result.build(categoryVoList, ResultCodeEnum.SUCCESS);
    }
}
